
import { ref,defineComponent } from 'vue'
const A = (_:any,{slots}) =>(<>
        <div> {slots.default?slots.default():'默认值' }</div>
        <h1>{slots.bb()}</h1>
    </>
)
export default defineComponent({
    // props:{ 
    //    name:String
    // },
    props:['name'],
    setup(props,{emit}){
        console.log(props,'=====');
        
        let arr = [1,2,3,4,5]
        const fn = (v:number):any=>{
            console.log(v);  
            emit('on-click',v)
        }       
        const slots = {
            default :()=>(<div>雷晶棋</div>),
            bb :()=>(<div>雷晶棋</div>)
        }
        return ()=>(
            <>
            <A v-slots={slots}>???</A>
            <div>Props{props.name}</div>
                {
                  arr.map(v=>{
                      return <div onClick={()=>(fn(v))} >${v}</div>
                  })
                }
            </>
        )
    }
})

